using System;
using System.Xml;
using System.Collections;
using System.Runtime.InteropServices;

namespace Scenario.Modules.PCM.DataModel.ConfigurationManager.Property
{
	//*********************************************************************
	//
	// XMLPropertyValue Class
	//
	// The PropertyValue class represents the caracteristics of an PropertyValues
	//
	//*********************************************************************
	public class XMLPropertyValue : bOS.XML.Data.XMLObject 
	{
		public const string MAIN_NODE = "Value";

		/** FIELDS **/

		public string sValue;

		/** CONSTRUCTORS **/

		/** CONSTRUCTOR Width simple value **/
		public XMLPropertyValue()
		{
			this.Init();
		}

		public XMLPropertyValue(string _Value)
		{
			sValue = _Value;
		}


		/** CONSTRUCTOR Width xml parsering**/
		public XMLPropertyValue(System.Xml.XmlNode node)
		{
			this.Parse (node);
		}

		/** PROPERTIES **/

		public string Value 
		{
			get { return sValue; }
			set { sValue = value; }
		}

		override public void Init()
		{
			sValue = string.Empty;
		}

		/** INSTANCE METHODS **/

		/** Parsering method for filling the property **/
		override public void Parse(System.Xml.XmlNode nodeList)
		{
			this.Init();

			sValue = nodeList.InnerXml;
		}

		override public bOS.XML.XMLNode GetXMLNode()
		{
			bOS.XML.XMLNode xmlNode = new bOS.XML.XMLNode(XMLPropertyValue.MAIN_NODE, sValue);
			
			return xmlNode;
		}
	}

}